package com.leyou.item.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.leyou.common.dto.SpecParamDTO;
import com.leyou.item.entity.SpecGroup;
import com.leyou.item.entity.SpecParam;
import com.leyou.item.mapper.ParamMapper;
import com.leyou.item.mapper.SpectMapper;
import com.leyou.item.service.ParamService;
import com.leyou.item.service.SpectService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ParamServiceImpl extends ServiceImpl<ParamMapper, SpecParam> implements ParamService {

    //根据spuId查询spu的所有规格参数值
    @Override
    public List<SpecParamDTO> QuerySpectParam(Long gid, Long cid, Boolean searching) {

     return SpecParamDTO.convertEntityList(
                query()
                        .eq(null!=gid,"group_id",gid)
                        .eq(null!=cid,"category_id",cid)
                        .eq(null!=searching,"searching",searching)
                        .list());
    }







}
